package com.example.final_project.Home.adapter;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.List;

public class FragAdapter extends FragmentPagerAdapter {
    private List<Fragment> Fragist;
    private List<String> tb_list;

    public FragAdapter(@NonNull FragmentManager fm, List<Fragment> list, List<String> tb_list) {
        super(fm);
        this.Fragist = list;
        this.tb_list = tb_list;
    }


    @NonNull
    @Override
    public Fragment getItem(int position) {
        return Fragist.get(position);
    }

    @Override
    public int getCount() {
        return Fragist.size();
    }

    @Nullable
    @Override
    public CharSequence getPageTitle(int position) {
        return tb_list.get(position);
    }
}
